package com.hanhai.zrb.api.biz.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hanhai.zrb.api.biz.service.ProjectFundSequenceService;
import com.hanhai.zrb.api.biz.service.SequenceService;
import com.hanhai.zrb.model.common.Sequence;

@Service
public class ProjectFundSequenceServiceImpl implements
		ProjectFundSequenceService {

	//项目编号的前缀
	public static final String PROJECT_PREFIX="X";
	//资金编号的前缀
	public static final String FUND_PREFIX="Z";
	@Resource
	private SequenceService sequenceService;
	
	@Override
	public String getNextProjectSequence() {
		Long no=sequenceService.getNextBySequenceName(Sequence.SequenceName.PROJECT_SEQUENCE.name());
		String projectNo = PROJECT_PREFIX+no;
		return projectNo;
	}

	@Override
	public String getNextFundSequence() {
		Long no=sequenceService.getNextBySequenceName(Sequence.SequenceName.FUND_SEQUENCE.name());
		String fundNo = FUND_PREFIX+no;
		return fundNo;
	}

}
